<?php
include "../modele/drink.php";
include_once "../vue/js/ajouterItemScript.php";
$drinks = Drink::dbGetDrinks("");

echo '<div id="theDrinks">
	<ul class="thumbnails">';
foreach($drinks as $drink){

	$name = $drink->getName();
	$image = $drink->getImg();
	$sPrice = $drink->getPriceSmall();
	$lPrice = $drink->getPriceLarge();
	$mPrice = $drink->getPriceMedium();
	$sScore = $drink->getScoreSmall();
	$lScore = $drink->getScoreLarge();
	$mScore = $drink->getScoreMedium();

	setlocale(LC_MONETARY, 'can_US');
	echo '<li class="span3">
			<div class="thumbnail" data-toggle="modal" data-target="#modal'.$name.'">
				<img style="height:140px;" src="img/'.$image.'" alt="'.$name.'">
				<h4>'.$name.'</h4>
				<div style="height:60px">'.$drink->getDescShort().'</div>
			</div>
				<!-- Pop-up -->
				<div id="modal'.$name.'" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
				  <div class="modal-header">
				    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				    <h3 id="myModalLabel">'.$name.'</h3>
				  </div>
				  <div class="modal-body">
				    <div class="left">
						<img class="selected" src="img/'.$image.'">
							<table class="selected">
								<tr>
									<td style="width:250px" id="petit">
										'.$drink->getTextSmall().'
									</td>
									<td style="width:250px" id="petit">
                                                                                <input name="page" type="button" class="btn btn-medium cash" value="'.number_format($sPrice, 2, ',', ' ').'$" onclick=\'ajouter("'.$name.'","'.$sPrice.'","P", "Cash", "D")\'></input>
									</td>
									<td style="width:250px" id="petit">
                                                                                <input name="page" type="button" class="btn btn-medium cash" value="'.$sScore.' Points" onclick=\'ajouter("'.$name.'","'.$sScore.'","P", "Score", "D")\'></input>
									</td>
								</tr>';
	if($mPrice > 0){
		echo '						<tr>
									<td style="width:250px" id="petit">
										'.$drink->getTextMedium().'
									</td>
									<td style="width:250px" id="petit">
                                                                                <input name="page" type="button" class="btn btn-medium cash" value="'.number_format($mPrice, 2, ',', ' ').'$" onclick=\'ajouter("'.$name.'","'.$mPrice.'","M", "Cash", "D")\'></input>
									</td>
									<td style="width:250px" id="petit">
                                                                                <input name="page" type="button" class="btn btn-medium cash" value="'.$mScore.' Points" onclick=\'ajouter("'.$name.'","'.$mScore.'","M", "Score", "D")\'></input>
									</td>
								</tr>';
	}
	if($lPrice > 0){
		echo '						<tr>
									<td style="width:250px" id="petit">
										'.$drink->getTextLarge().'
									</td>
									<td style="width:250px" id="petit">
                                                                                <input name="page" type="button" class="btn btn-medium cash" value="'.number_format($lPrice, 2, ',', ' ').'$" onclick=\'ajouter("'.$name.'","'.$lPrice.'","L", "Cash", "D")\'></input>
									</td>
									<td style="width:250px" id="petit">
                                                                                <input name="page" type="button" class="btn btn-medium cash" value="'.$lScore.' Points" onclick=\'ajouter("'.$name.'","'.$lScore.'","L", "Score", "D")\'></input>
									</td>
								</tr>';
	}
	echo '
							</table>
							</div>
							<div class="right">
								<p class="selected">'.$drink->getDescLong().'</p>
							</div>
				  </div>
				  <div class="modal-footer">
				    <button class="btn" data-dismiss="modal" aria-hidden="true">Fermer</button>
				  </div>
			</div>
		</li>';
}
echo 	"</ul>";
echo "</div>";

?>






